<extend name="./Common/View/Public/form.html" />
<block name="page_title">编辑教师</block>
<block name="main">
    <form class="layui-form" method="post" action="base/teacher/update" lay-filter="pageForm">
        <input type="hidden" name="id" value="{$data.id}">
        <div class="layui-form-item">
            <label class="layui-form-label">工号</label>
            <div class="layui-input-inline">
                <input type="text" name="number" value="{$data.number}" readonly maxlength="30" minlength="1" lay-verify="required|length" placeholder="请输入工号" autocomplete="off" class="layui-input" />
            </div>
            <div class="layui-form-mid layui-word-aux">1-20个英文或数字</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">姓名</label>
            <div class="layui-input-inline">
                <input type="text" name="name" value="{$data.name}" maxlength="30" minlength="1" lay-verify="required|length" placeholder="请输入姓名" autocomplete="off" class="layui-input" />
            </div>
            <div class="layui-form-mid layui-word-aux">1-20个英文或汉字</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">所在部门</label>
            <div class="layui-input-block">
                <select name="depart_id" id="depart_id" lay-filter="depart_id" value="{$data.depart_id}" tree="base/Department/tree/status/1" empty="未分配部门">
                </select>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">岗位类型</label>
            <div class="layui-input-block">
                {:W('Todo/Dict/radio',array('SCHOOL_POSITION','position',$data['position']))}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-block">
                {:W('Todo/Dict/radio',array('SEX','sex',$data['sex']))}
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline">
                <input type="email" name="email" value="{$data.email}" lay-verify="email" placeholder="请输入电子邮箱" autocomplete="off" class="layui-input" />
            </div>
            <div class="layui-form-mid layui-word-aux">1-20个英文或汉字</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">手机号</label>
            <div class="layui-input-inline">
                <input type="text" name="phone" value="{$data.phone}" lay-verify="phone" placeholder="请输入手机号" autocomplete="off" class="layui-input" />
            </div>
            <div class="layui-form-mid layui-word-aux">有效的手机号码</div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">联系地址</label>
            <div class="layui-input-block">
                <input type="text" name="address" value="{$data.address}" maxlength="50" lay-verify="length" placeholder="请输入联系地址" autocomplete="off" class="layui-input" />
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-inline">
                <input type="text" class="layui-input" laydate name="birthday" id="birthday" placeholder="{:date('Y-m-d')}" value="{:format_date($data['birthday'])}">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-block">
                {:W('Todo/Dict/radio',array('STATUS','status',$data['status']))}
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn" lay-submit lay-filter="pageForm">立即提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </div>
    </form>
</block>

<block name="script">
    <script>
        layui.use('laydate', function() {
            var laydate = layui.laydate;

            //常规用法
            laydate.render({
                elem: '#birthday'
            });
        });
    </script>
</block>